<?php
namespace app\api\validate;

use think\Validate;

class AdminValidate extends Validate{
    protected $rule =   [
        'id'            => 'require|number',
        'curr'          => 'require|number',
        'limit'         => 'require|number',
        'user_id'       => 'require|number',
        'admin_id'      => 'require|number',
        'city'          => 'require|length:1,30',
    ];
    
    protected $message  =   [
        'id.require'            => 'ID必须',
        'id.number'             => 'ID必须是数字',
        'curr.require'          => '页数必须',
        'curr.number'           => '页数数据类型错误',
        'limit.require'         => '条数必须',
        'limit.number'          => '条数数据类型错误',
        'user_id.require'       => '用户ID必须',
        'user_id.number'        => '用户ID数据类型错误',
        'admin_id.require'      => '店铺ID必须',
        'admin_id.number'       => '店铺ID数据类型错误',
        'city.require'          => '城市不能为空',
        'city.number'           => '城市名称长度错误',
    ];
    
    protected $scene = [
        'list'        => ['curr', 'limit'],
        'bind'        => ['user_id', 'admin_id'],
        'show'        => ['admin_id'],
    ];
}